<!DOCTYPE html>
<head xmlns:v-bind="http://www.w3.org/1999/xhtml" >
    <meta charset="UTF-8">
    <title>demo5模板语法-过滤器</title>
  <script src="./js/vue.min.js"></script>

</head>

<body>
   <div id="app">
     {{ message | capitalize }}
   </div>
   <script type="application/javascript">
     var vm = new Vue({
       el: "#app",
       data: {
         message: "runoobname!"
       },
       filters: {
         capitalize: function (value) {
           if( !value ){
             return '';
           }
           value = value.toString();
           return value.charAt(0).toUpperCase() +value.slice(1,6)
             +value.charAt(6).toUpperCase() +value.slice(7);
         }
       }
     });


   </script>
</body>

</html>
